﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace FierceWar
{
	public class PlayerLevel : ActorLevel
	{
		private float _mana;
		public float Mana
		{
			get
			{
				return _mana;
			}
			set
			{
				_mana = Math.Max(0.0f, value);
			}
		}

		private float _manaRecovery;
		public float ManaRecovery
		{
			get
			{
				return _manaRecovery;
			}
		}

		private float _timeToRecovery = 1000.0f;
		public float TimeToRecovery
		{
			get
			{
				return _timeToRecovery;
			}
		}

		private float _timeToEnableText = 600.0f;
		public float TimeToEnableText
		{
			get
			{
				return _timeToEnableText;
			}
		}

		private float _timeToDisableText = 300.0f;
		public float TimeToDisableText
		{
			get
			{
				return _timeToDisableText;
			}
		}

		public PlayerLevel(int level)
			: base(level)
		{
			_level = (int)MathHelper.Clamp(level, 1, 100);

			_bulletsCapacity = (int)MathHelper.Clamp(_level * 30, 30, 120);

			_timeToChargeBullet =
				MathHelper.Clamp(5500.0f - (_level * 500.0f), 2000.0f, 5000.0f);

			Health = MathHelper.Clamp(_level * 50.0f, 100.0f, 1000.0f);
			Mana = MathHelper.Clamp(_level * 50.0f, 100.0f, 500.0f);

			_healthRecovery = MathHelper.Clamp(_level / 5.0f, 0.0f, 1.0f);
			_manaRecovery = _level;

			_damage = _level * 10;
			_armor = _level * 2;
		}
	}
}
